Skip to content

Add Godot API wrapper repo link to README.md#1526

Open
UbeJelly wants to merge 2 commits into
PokeAPI:masterfrom
UbeJelly:Godot_API_Wrapper
Open

Add Godot API wrapper repo link to README.md#1526
UbeJelly wants to merge 2 commits into
PokeAPI:masterfrom
UbeJelly:Godot_API_Wrapper

Conversation

@UbeJelly
Copy link
Copy Markdown

@UbeJelly UbeJelly commented May 19, 2026

Change description

I added my Godot API wrapper, PokeDot repository's link to the Wrappers section in README.
I believe there's no API wrapper for Godot yet so I made one, and maybe some people may find it useful.

TESTS:
As for testing I don't know how I'll test it on workflows, but it is easy to test with under a new Godot 4 project.
I also haven't checked it below as I'm not sure if this example counts..

The main class PokeDotClient is an HTTPRequest node, and it handles the requests for pokeapi's v2 API.

So to use it:

  1. Just copy the Resources folder, PokeDotClient.gd, and PokeDotClient.tscn into the new Godot project directory.
  2. Make a new Node, add its script, and instantiate PokeDotClient. For this example we'll get an ability and berry from 1st index: image
  3. Run it. It should display something like this in the console:
image image image

The first output comes from PokeDotClient's get_pokemon_pagination() when it is ready. Just remove it if not needed.
The 2nd and 3rd outputs come from the Ability and Berry classes under Resources directory.

Note that to make a lot of requests, you have to wait for a request to complete first. So await the request_completed signal emitted by PokeDotClient:
await this_instanced_PokeDotClient.request_completed

That's all! Feel free to give some feedback with this project ^^

Here's a repo to quickly clone and run it on Godot 4: https://github.com/UbeJelly/PokeDotTest

AI coding assistance disclosure

I don't use AI in any of my works, so this codebase too didn't have any AI assistance.

Contributor check list

  • I have written a description of the contribution and explained its motivation.
  • I have written tests for my code changes (if applicable).
  • I have read and understood the AI Assisted Contribution guidelines.
  • I will own this change in production, and I am prepared to fix any bugs caused by my code change.

@UbeJelly
Copy link
Copy Markdown
Author

Just an update on how to access the actual data instead of just printing it.

The request_completed signal must be emitted first in order to get the data, but here getting the data returns empty values as it is called in ready() and as such not completed yet.

So in order to get the values after completing the request:
image

  1. Call the method first e.g. get_ability(1)
  2. Wait till it's request is completed - await pokeapi.request_completed
  3. Then you can access its (PokeDotClient) child node Ability.gd, and call its get_data(): pokeapi.ability.get_data()
  4. The values can now be used as needed:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant